﻿using UnityEngine;

namespace iTManager
{
    public static class iTweenExtension
    {
        public static void AudioFrom(this GameObject obj, float volume, float pitch, float time)
        {
            obj.AudioFrom(new AudioFrom() { volume = volume, pitch = pitch, time = time }).Start();
        }

        public static iTweenEvent AudioFrom(this GameObject obj, AudioFrom audioFrom)
        {
            return new iTweenEvent(obj, audioFrom.ToHastable(), (o, h) => iTweenBase.AudioFrom(o, h));
        }

        public static void AudioTo(this GameObject obj, float volume, float pitch, float time)
        {
            obj.AudioTo(new AudioTo() { volume = volume, pitch = pitch, time = time }).Start();
        }

        public static iTweenEvent AudioTo(this GameObject obj, AudioTo audioTo)
        {
            return new iTweenEvent(obj, audioTo.ToHastable(), (o, h) => iTweenBase.AudioTo(o, h));
        }

        public static void AudioUpdate(this GameObject obj, float volume, float pitch, float time)
        {
            obj.AudioUpdate(new AudioUpdate() { volume = volume, pitch = pitch, time = time });
        }

        public static void AudioUpdate(this GameObject obj, AudioUpdate audioUpdate)
        {
            new iTweenEvent(obj, audioUpdate.ToHastable(), (o, h) => iTweenBase.AudioUpdate(o, h)).Start();
        }

        public static void ColorFrom(this GameObject obj, Color color, float time)
        {
            obj.ColorFrom(new ColorFrom() { color = color, time = time }).Start();
        }

        public static iTweenEvent ColorFrom(this GameObject obj, ColorFrom colorFrom)
        {
            return new iTweenEvent(obj, colorFrom.ToHastable(), (o, h) => iTweenBase.ColorFrom(o, h));
        }

        public static void ColorTo(this GameObject obj, Color color, float time)
        {
            obj.ColorTo(new ColorTo() { color = color, time = time }).Start();
        }

        public static iTweenEvent ColorTo(this GameObject obj, ColorTo colorTo)
        {
            return new iTweenEvent(obj, colorTo.ToHastable(), (o, h) => iTweenBase.ColorTo(o, h));
        }

        public static void ColorUpdate(this GameObject obj, Color color, float time)
        {
            obj.ColorUpdate(new ColorUpdate() { color = color, time = time });
        }

        public static void ColorUpdate(this GameObject obj, ColorUpdate colorUpdate)
        {
            new iTweenEvent(obj, colorUpdate.ToHastable(), (o, h) => iTweenBase.ColorUpdate(o, h)).Start();
        }

        public static void FadeFrom(this GameObject obj, float alpha, float time)
        {
            obj.FadeFrom(new FadeFrom() { alpha = alpha, time = time }).Start();
        }

        public static iTweenEvent FadeFrom(this GameObject obj, FadeFrom fadeFrom)
        {
            return new iTweenEvent(obj, fadeFrom.ToHastable(), (o, h) => iTweenBase.FadeFrom(o, h));
        }

        public static void FadeTo(this GameObject obj, float alpha, float time)
        {
            obj.FadeTo(new FadeTo() { alpha = alpha, time = time }).Start();
        }

        public static iTweenEvent FadeTo(this GameObject obj, FadeTo fadeTo)
        {
            return new iTweenEvent(obj, fadeTo.ToHastable(), (o, h) => iTweenBase.FadeTo(o, h));
        }

        public static void FadeUpdate(this GameObject obj, float alpha, float time)
        {
            obj.FadeUpdate(new FadeUpdate() { alpha = alpha, time = time });
        }

        public static void FadeUpdate(this GameObject obj, FadeUpdate fadeUpdate)
        {
            new iTweenEvent(obj, fadeUpdate.ToHastable(), (o, h) => iTweenBase.FadeUpdate(o, h)).Start();
        }

        public static void LookFrom(this GameObject obj, Vector3 lookTarget, float time)
        {
            obj.LookFrom(new LookFrom() { looktarget_Vector3 = lookTarget, time = time }).Start();
        }

        public static iTweenEvent LookFrom(this GameObject obj, LookFrom lookFrom)
        {
            return new iTweenEvent(obj, lookFrom.ToHastable(), (o, h) => iTweenBase.LookFrom(o, h));
        }

        public static void LookTo(this GameObject obj, Vector3 lookTarget, float time)
        {
            obj.LookTo(new LookTo() { looktarget_Vector3 = lookTarget, time = time }).Start();
        }

        public static iTweenEvent LookTo(this GameObject obj, LookTo lookTo)
        {
            return new iTweenEvent(obj, lookTo.ToHastable(), (o, h) => iTweenBase.LookTo(o, h));
        }

        public static void LookUpdate(this GameObject obj, Vector3 lookTarget, float time)
        {
            obj.LookUpdate(new LookUpdate() { looktarget_Vector3 = lookTarget, time = time });
        }

        public static void LookUpdate(this GameObject obj, LookUpdate lookUpdate)
        {
            new iTweenEvent(obj, lookUpdate.ToHastable(), (o, h) => iTweenBase.LookUpdate(o, h)).Start();
        }

        public static void MoveAdd(this GameObject obj, Vector3 amount, float time)
        {
            obj.MoveAdd(new MoveAdd() {  amount_Vector3 = amount, time = time }).Start();
        }

        public static iTweenEvent MoveAdd(this GameObject obj, MoveAdd moveAdd)
        {
            return new iTweenEvent(obj, moveAdd.ToHastable(), (o, h) => iTweenBase.MoveAdd(o, h));
        }

        public static void MoveBy(this GameObject obj, Vector3 amount, float time)
        {
            obj.MoveBy(new MoveBy() { amount_Vector3 = amount, time = time }).Start();
        }

        public static iTweenEvent MoveBy(this GameObject obj, MoveBy moveBy)
        {
            return new iTweenEvent(obj, moveBy.ToHastable(), (o, h) => iTweenBase.MoveBy(o, h));
        }

        public static void MoveFrom(this GameObject obj, Vector3 position, float time)
        {
            obj.MoveFrom(new MoveFrom() { position_Vector3 = position, time = time }).Start();
        }

        public static iTweenEvent MoveFrom(this GameObject obj, MoveFrom moveFrom)
        {
            return new iTweenEvent(obj, moveFrom.ToHastable(), (o, h) => iTweenBase.MoveFrom(o, h));
        }

        public static void MoveTo(this GameObject obj, Vector3 position, float time)
        {
            obj.MoveTo(new MoveTo() { position_Vector3 = position, time = time }).Start();
        }

        public static iTweenEvent MoveTo(this GameObject obj, MoveTo moveTo)
        {
            return new iTweenEvent(obj, moveTo.ToHastable(), (o, h) => iTweenBase.MoveTo(o, h));
        }

        public static void MoveUpdate(this GameObject obj, Vector3 position, float time)
        {
            obj.MoveUpdate(new MoveUpdate() { position_Vector3 = position, time = time });
        }

        public static void MoveUpdate(this GameObject obj, MoveUpdate moveUpdate)
        {
            new iTweenEvent(obj, moveUpdate.ToHastable(), (o, h) => iTweenBase.MoveUpdate(o, h)).Start();
        }

        public static void PunchPosition(this GameObject obj, Vector3 amount, float time)
        {
            obj.PunchPosition(new PunchPosition() { amount_Vector3 = amount, time = time }).Start();
        }

        public static iTweenEvent PunchPosition(this GameObject obj, PunchPosition punchPosition)
        {
            return new iTweenEvent(obj, punchPosition.ToHastable(), (o, h) => iTweenBase.PunchPosition(o, h));
        }

        public static void PunchRotation(this GameObject obj, Vector3 amount, float time)
        {
            obj.PunchRotation(new PunchRotation() { amount_Vector3 = amount, time = time }).Start(); ;
        }

        public static iTweenEvent PunchRotation(this GameObject obj, PunchRotation punchRotation)
        {
            return new iTweenEvent(obj, punchRotation.ToHastable(), (o, h) => iTweenBase.PunchRotation(o, h));
        }

        public static void PunchScale(this GameObject obj, Vector3 amount, float time)
        {
            obj.PunchScale(new PunchScale() { amount_Vector3 = amount, time = time }).Start();
        }

        public static iTweenEvent PunchScale(this GameObject obj, PunchScale punchScale)
        {
            return new iTweenEvent(obj, punchScale.ToHastable(), (o, h) => iTweenBase.PunchScale(o, h));
        }

        public static void RotateAdd(this GameObject obj, Vector3 amount, float time)
        {
            obj.RotateAdd(new RotateAdd() { amount_Vector3 = amount, time = time }).Start();
        }

        public static iTweenEvent RotateAdd(this GameObject obj, RotateAdd rotateAdd)
        {
            return new iTweenEvent(obj, rotateAdd.ToHastable(), (o, h) => iTweenBase.RotateAdd(o, h));
        }

        public static void RotateBy(this GameObject obj, Vector3 amount, float time)
        {
            obj.RotateBy(new RotateBy() { amount_Vector3 = amount, time = time }).Start();
        }

        public static iTweenEvent RotateBy(this GameObject obj, RotateBy rotateBy)
        {
            return new iTweenEvent(obj, rotateBy.ToHastable(), (o, h) => iTweenBase.RotateBy(o, h));
        }

        public static void RotateFrom(this GameObject obj, Vector3 rotation, float time)
        {
            obj.RotateFrom(new RotateFrom() { rotation_Vector3 = rotation, time = time }).Start();
        }

        public static iTweenEvent RotateFrom(this GameObject obj, RotateFrom rotateFrom)
        {
            return new iTweenEvent(obj, rotateFrom.ToHastable(), (o, h) => iTweenBase.RotateFrom(o, h));
        }

        public static void RotateTo(this GameObject obj, Vector3 rotation, float time)
        {
            obj.RotateTo(new RotateTo() { rotation_Vector3 = rotation, time = time }).Start();
        }

        public static iTweenEvent RotateTo(this GameObject obj, RotateTo rotateTo)
        {
            return new iTweenEvent(obj, rotateTo.ToHastable(), (o, h) => iTweenBase.RotateTo(o, h));
        }

        public static void RotateUpdate(this GameObject obj, Vector3 rotation, float time)
        {
            obj.RotateUpdate(new RotateUpdate() { rotation_Vector3 = rotation, time = time });
        }

        public static void RotateUpdate(this GameObject obj, RotateUpdate rotateUpdate)
        {
            new iTweenEvent(obj, rotateUpdate.ToHastable(), (o, h) => iTweenBase.RotateUpdate(o, h)).Start();
        }

        public static void ScaleAdd(this GameObject obj, Vector3 amount, float time)
        {
            obj.ScaleAdd(new ScaleAdd() { amount_Vector3 = amount, time = time }).Start();
        }

        public static iTweenEvent ScaleAdd(this GameObject obj, ScaleAdd scaleAdd)
        {
            return new iTweenEvent(obj, scaleAdd.ToHastable(), (o, h) => iTweenBase.ScaleAdd(o, h));
        }

        public static void ScaleBy(this GameObject obj, Vector3 amount, float time)
        {
            obj.ScaleBy(new ScaleBy() { amount_Vector3 = amount, time = time }).Start();
        }

        public static iTweenEvent ScaleBy(this GameObject obj, ScaleBy scaleBy)
        {
            return new iTweenEvent(obj, scaleBy.ToHastable(), (o, h) => iTweenBase.ScaleBy(o, h));
        }

        public static void ScaleFrom(this GameObject obj, Vector3 scale, float time)
        {
            obj.ScaleFrom(new ScaleFrom() { scale_Vector3 = scale, time = time }).Start();
        }

        public static iTweenEvent ScaleFrom(this GameObject obj, ScaleFrom scaleFrom)
        {
            return new iTweenEvent(obj, scaleFrom.ToHastable(), (o, h) => iTweenBase.ScaleFrom(o, h));
        }

        public static void ScaleTo(this GameObject obj, Vector3 scale, float time)
        {
            obj.ScaleTo(new ScaleTo() { scale_Vector3 = scale, time = time }).Start();
        }

        public static iTweenEvent ScaleTo(this GameObject obj, ScaleTo scaleTo)
        {
            return new iTweenEvent(obj, scaleTo.ToHastable(), (o, h) => iTweenBase.ScaleTo(o, h));
        }

        public static void ScaleUpdate(this GameObject obj, Vector3 scale, float time)
        {
            obj.ScaleUpdate(new ScaleUpdate() { scale_Vector3 = scale, time = time });
        }

        public static void ScaleUpdate(this GameObject obj, ScaleUpdate scaleUpdate)
        {
            new iTweenEvent(obj, scaleUpdate.ToHastable(), (o, h) => iTweenBase.ScaleUpdate(o, h)).Start();
        }

        public static void ShakePosition(this GameObject obj, Vector3 amount, float time)
        {
            obj.ShakePosition(new ShakePosition() { amount_Vector3 = amount, time = time }).Start();
        }

        public static iTweenEvent ShakePosition(this GameObject obj, ShakePosition shakePosition)
        {
            return new iTweenEvent(obj, shakePosition.ToHastable(), (o, h) => iTweenBase.ShakePosition(o, h));
        }

        public static void ShakeRotation(this GameObject obj, Vector3 amount, float time)
        {
            obj.ShakeRotation(new ShakeRotation() { amount_Vector3 = amount, time = time }).Start();
        }

        public static iTweenEvent ShakeRotation(this GameObject obj, ShakeRotation shakeRotation)
        {
            return new iTweenEvent(obj, shakeRotation.ToHastable(), (o, h) => iTweenBase.ShakeRotation(o, h));
        }

        public static void ShakeScale(this GameObject obj, Vector3 amount, float time)
        {
            obj.ShakeScale(new ShakeScale() { amount_Vector3 = amount, time = time }).Start();
        }

        public static iTweenEvent ShakeScale(this GameObject obj, ShakeScale shakeScale)
        {
            return new iTweenEvent(obj, shakeScale.ToHastable(), (o, h) => iTweenBase.ShakeScale(o, h));
        }

        public static void Stab(this GameObject obj, AudioClip audioClip, float delay)
        {
            obj.Stab(new Stab() { audioclip = audioClip, delay = delay }).Start();
        }

        public static iTweenEvent Stab(this GameObject obj, Stab stab)
        {
            return new iTweenEvent(obj, stab.ToHastable(), (o, h) => iTweenBase.Stab(o, h));
        }

        public static iTweenEvent ValueTo(this GameObject obj, ValueTo valueTo)
        {
            return new iTweenEvent(obj, valueTo.ToHastable(), (o, h) => iTweenBase.ValueTo(o, h));
        }
    }
}
